#include "ThreadPool.hpp"
#include "Task.hpp"



int main()
{
    // ThreadPool<Task>* tp = new ThreadPool<Task>(5);
    // tp->Init();
    // tp->Start();

    int cnt = 10;
    while(cnt--)
    {
        sleep(1);
        Task t(1, 1);
        // GetInstance() 获取的都是同一个地址，是唯一的
        ThreadPool<Task>::GetInstance()->Equeue(t);
        sleep(1);
        //std::cout << "cnt: " << cnt-- << std::endl;
        LOG(INFO, "equeue a task, %s\n", t.debug().c_str());
    }
    ThreadPool<Task>::GetInstance()->Stop();
    //tp->Stop();
    //std::cout << "thread pool stop" << std::endl;
    LOG(INFO, "thread pool stop!\n");
    sleep(10);
    return 0;
}